package com.example.learn.hwod;

import java.util.Scanner;

public class _12计算面积 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int endX = sc.nextInt();
        long ans = 0 ;
        long lastX =0;
        long lastY =0;

        for (int i = 0; i < n; i++) {
            int curX = sc.nextInt();
            int offsetY =sc.nextInt();


            ans +=(curX-lastX)*Math.abs(lastY);
            lastX = curX;
            lastY+=offsetY;
        }

        if (endX>lastX) {
            ans+=(endX-lastX)*Math.abs(lastY);
        }

        System.out.println(ans);
    }
}
